package javaFeatures.src.TestFeature.oopcourse;

public class Circle {
    private double radius;

    public void setRadius(double r) {
        radius = r;
    }

    public double getRadius() {
        return radius;
    }
    public double calculateArea() {
        return Math.PI * radius * radius;
    }

    public double calculateCircumference() {
        return 2 * Math.PI * radius;
    }

    public static void main(String[] args) {
        Circle circle = new Circle();
        circle.setRadius(5.0);

        double area = circle.calculateArea();
        double circumference = circle.calculateCircumference();

        System.out.println("半径: " + circle.getRadius());
        System.out.println("面积: " + area);
        System.out.println("周长: " + circumference);
    }
}